Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(major): Refactor entire india banking client side flows #13

Open
wants to merge 84 commits into
base: dev
Choose a base branch
from

Conversation

Bhavan23
Copy link
Collaborator

@Bhavan23 Bhavan23 commented Jan 2, 2025

No description provided.

refactor: update install file path
refactor: single payment code add in bank connector
fix: add filter to the bank account
fix: fetch company bank account details during the API call
fix: rename method action in payload
"maximum_limit": 200000,
"start_time": "0:00:00",
"end_time": "23:59:59",
"disabled": 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is every mode of transfer, by default disabled?

{
"mode": "RTGS",
"minimum_limit": 200000,
"maximum_limit": 50000000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make 50 Crore as the upper limit, beyond that LEI number is required.

{
"mode": "NEFT",
"minimum_limit": 0,
"maximum_limit": 100000000000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make 50 Crore as the upper limit, beyond that LEI number is required.

"start_time": "0:00:00",
"end_time": "23:59:59",
"disabled": 1,
"priority": "1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is account specific. Please bring in that key here. And do the following priority.

  1. A2A
  2. IMPS
  3. RTGS
  4. NEFT

by default. Let the user re-order as per their need.

]

STD_BANK_LIST = [
"Yes Bank",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Yes Bank as of now. Reorder this in alphabetical order.


after_install = ["india_banking.install.after_install"]

before_uninstall = "india_banking.uninstall.before_uninstall"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put this in array too? Is it supported?

Copy link
Collaborator Author

@Bhavan23 Bhavan23 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but i modify because it is only one path.

india_banking/hooks.py Outdated Show resolved Hide resolved
}

doc_events = {
"Bank": {"on_trash": "india_banking.india_banking.doc_events.bank.bank_on_trash"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this function as disallow_standard_bank_deletion

@@ -8,7 +8,8 @@ frappe.ui.form.on("Bank Connector", {
filters: {
disabled: 0,
is_default: 1,
is_company_account: 1
is_company_account: 1,
company: doc.company,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the standard linter and rectify the spacing for the entire repository.



def validate_ifsc_code(doc, method=None):
if not IFSC_PATTERN.match(cstr(doc.branch_code)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User often get confused with branch code and IFSC code. Can we set the label as IFSC Code for this field if this app is installed?

chore: rename 'bank_on_trash' to 'disallow_standard_bank_deletion'
fix: update maximum limit for all mode of transfer
chore: rename 'Branch Code' label to 'IFSC Code' in bank account doc
]

STD_BANK_LIST = [
"HDFC Bank",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is Axis Bank, removed?

"insert_after": "posting_date",
},
{
"label": "ICICI Bank Api Info",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bank specific fields can be avoided. What shall we do here?

"fieldname": "grand_total",
"property": "reqd",
"property_type": "Check",
"value": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it set to 0?, Is the grand_total not mandatory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grand total will be calculated using the net total. we keep net total as mandatory


def create_default_payment_type():
if not frappe.db.exists("Payment Type", "Pay"):
frappe.get_doc({"doctype": "Payment Type", "payment_type": "Pay"}).insert(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of ignoring mandatory, can we not get the default accounts payable account from the company and set it to the payment type?

function get_bank_query_conditions(frm) {
let conditions = {
company: frm.doc.company,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you also like to consider the workflow state as approved here?
And is company filter required? Does bank account have company and is it mandatory?

"You cannot cancel a payment order with Initiated/Processed payments"
)
)
super().on_cancel()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?

Copy link
Collaborator Author

@Bhavan23 Bhavan23 Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on_cancel is already there in the ERPNext app. They are using on_cancel to update the status.

from frappe import _


class CustomPaymentEntry(PaymentEntry):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you're not overriding anything here, then this class and file is not required? Can you move the below code elsewhere and remove this class and file.

)
.where(
(JournalEntryAccount.parent == source.name)
& (JournalEntryAccount.party_type == "Employee")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean, we do not allow any supplier, customer bank entry type journal entries?

"account",
"cost_center",
"project",
"debit as amount",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming debit and debit in account currency as same here? Can you add currency as INR as a validation in the query?

frappe.db.commit()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you manually commiting?

Copy link
Collaborator Author

@Bhavan23 Bhavan23 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid request and response data loss while processing the response, some time will raise an error.

@Vigneshsekar Vigneshsekar changed the title Refactor dev refactor(major): Refactor entire india banking client side flows Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants